using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("Transfers")]
	[Serializable]
    public class Transfer : DBO<Transfer>
    {
		#region Fields
		
		private int? _IdTransfer;
		private int? _IdPlayer;
		private int? _IdClubFrom;
		private int? _IdClubTo;
		private DateTime? _TransferDate;
		private int? _Price;
		private string _Method;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public Transfer()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdTransfer 
		/// </summary>
		/// <param name="IdTransfer">The IdTransfer</param>
		public Transfer(int? IdTransfer )
		{
			this.IdTransfer = IdTransfer;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdTransfer">Sets int? value for IdTransfer</param>
		/// <param name="IdPlayer">Sets int? value for IdPlayer</param>
		/// <param name="IdClubFrom">Sets int? value for IdClubFrom</param>
		/// <param name="IdClubTo">Sets int? value for IdClubTo</param>
		/// <param name="TransferDate">Sets DateTime? value for TransferDate</param>
		/// <param name="Price">Sets int? value for Price</param>
		/// <param name="Method">Sets string value for Method</param>
		public Transfer(int? idTransfer, int? idPlayer, int? idClubFrom, int? idClubTo, DateTime? transferDate, int? price, string method)
		{
			this.IdTransfer = idTransfer;
			this.IdPlayer = idPlayer;
			this.IdClubFrom = idClubFrom;
			this.IdClubTo = idClubTo;
			this.TransferDate = transferDate;
			this.Price = price;
			this.Method = method;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdTransfer
		/// </summary>
		[ColumnAttribute("IdTransfer", SqlDbType.Int , 4 , true, true, false)]
		public int? IdTransfer
		{
			set
			{
				this._IdTransfer = value;
			}
			get
			{
				return this._IdTransfer;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdPlayer
		/// </summary>
		[ColumnAttribute("IdPlayer", SqlDbType.Int , 4 , false, false, true)]
		public int? IdPlayer
		{
			set
			{
				this._IdPlayer = value;
			}
			get
			{
				return this._IdPlayer;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdClubFrom
		/// </summary>
		[ColumnAttribute("IdClubFrom", SqlDbType.Int , 4 , false, false, true)]
		public int? IdClubFrom
		{
			set
			{
				this._IdClubFrom = value;
			}
			get
			{
				return this._IdClubFrom;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdClubTo
		/// </summary>
		[ColumnAttribute("IdClubTo", SqlDbType.Int , 4 , false, false, true)]
		public int? IdClubTo
		{
			set
			{
				this._IdClubTo = value;
			}
			get
			{
				return this._IdClubTo;
			}
		}
		
		/// <summary>
		/// Gets or sets DateTime? value for TransferDate
		/// </summary>
		[ColumnAttribute("TransferDate", SqlDbType.DateTime , 8 , false, false, true)]
		public DateTime? TransferDate
		{
			set
			{
				this._TransferDate = value;
			}
			get
			{
				return this._TransferDate;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for Price
		/// </summary>
		[ColumnAttribute("Price", SqlDbType.Int , 4 , false, false, true)]
		public int? Price
		{
			set
			{
				this._Price = value;
			}
			get
			{
				return this._Price;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Method
		/// </summary>
		[ColumnAttribute("Method", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Method
		{
			set
			{
				this._Method = value;
			}
			get
			{
				return this._Method;
			}
		}
		
		
		/// <summary>
		/// Get a Club of current Transfer object base on IdClubFrom
		/// </summary>
		public Club ClubFrom
		{
			get
			{
				if (this.IdClubFrom == null)
					return null;
	
				Club condition = new Club(this.IdClubFrom);
				return ClubController.FindItem(condition);
			}
		}
		
		/// <summary>
		/// Get a Club of current Transfer object base on IdClubTo
		/// </summary>
		public Club ClubTo
		{
			get
			{
				if (this.IdClubTo == null)
					return null;
	
				Club condition = new Club(this.IdClubTo);
				return ClubController.FindItem(condition);
			}
		}
		
		/// <summary>
		/// Get a Player of current Transfer object base on IdPlayer
		/// </summary>
		public Player Player
		{
			get
			{
				if (this.IdPlayer == null)
					return null;
	
				Player condition = new Player(this.IdPlayer);
				return PlayerController.FindItem(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdTransfer]
            /// </summary>
            public string IdTransfer
            {
                get
                {
                    return "IdTransfer";
                }
            }
            /// <summary>
            /// Get the name of column [IdPlayer]
            /// </summary>
            public string IdPlayer
            {
                get
                {
                    return "IdPlayer";
                }
            }
            /// <summary>
            /// Get the name of column [IdClubFrom]
            /// </summary>
            public string IdClubFrom
            {
                get
                {
                    return "IdClubFrom";
                }
            }
            /// <summary>
            /// Get the name of column [IdClubTo]
            /// </summary>
            public string IdClubTo
            {
                get
                {
                    return "IdClubTo";
                }
            }
            /// <summary>
            /// Get the name of column [TransferDate]
            /// </summary>
            public string TransferDate
            {
                get
                {
                    return "TransferDate";
                }
            }
            /// <summary>
            /// Get the name of column [Price]
            /// </summary>
            public string Price
            {
                get
                {
                    return "Price";
                }
            }
            /// <summary>
            /// Get the name of column [Method]
            /// </summary>
            public string Method
            {
                get
                {
                    return "Method";
                }
            }
        }
        #endregion
    }
}
